import {defineStore} from "pinia";

const personStore = defineStore("personStore", {
    state:() => {
        return{
            username: "张三",
            age: 23,
            hobbies: ['唱歌', '跳舞']
        }
    },
    getters:{
        getHobbyCount: (state) => state.hobbies.length,
        getAge(){
            return this.age
        }
    },
    actions:{
        doubleAge(){
            this.age = this.age + 1
        }
    }
})

export default personStore
